'\" t
.\"     Title: json2xml
.\"    Author: Ladislav Lhotka <lhotka@nic.cz>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 2017-06-27
.\"    Manual: pyang manual
.\"    Source: json2xml-1.7.3
.\"  Language: English
.\"
.TH "JSON2XML" "1" "2017\-06\-27" "json2xml\-1\&.7\&.3" "pyang manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
json2xml \- translates JSON documents conforming to a YANG data model into XML\&.
.SH "SYNOPSIS"
.HP \w'\fBjson2xml\fR\ 'u
\fBjson2xml\fR [\-t\ \fItarget\fR] [\-o\ \fIoutput_file\fR] \fIdriver_file\fR \fIjson_file\fR
.HP \w'\fBjson2xml\fR\ 'u
\fBjson2xml\fR \-h | \-\-help 
.SH "DESCRIPTION"
.PP
This program translates
\fIjson_file\fR
into XML using the procedure specified in
\m[blue]\fBdraft\-lhotka\-netmod\-yang\-json\fR\m[]\&\s-2\u[1]\d\s+2\&.
.PP
The translation uses a second input file,
\fIdriver_file\fR, which contains a concise JSON representation of the YANG data model to which
\fIjson_file\fR
should conform, at least structurally\&. Normally,
\fIdriver_file\fR
is obtained as the
\fIjtox\fR
output of
\fBpyang\fR\&.
.PP
Using "\-" (hyphen) in place of
\fIjson_file\fR
instructs the program to read a JSON document from the standard input\&.
.PP
The
\fItarget\fR
argument specifies the document (root) element for the output XML document\&. This encapsulation is necessary because the input JSON document may contain multiple JSON objects at the top level\&. Supported values for the
\fItarget\fR
argument are:
.PP
data
.RS 4
The document element will be <nc:data>\&. This is the default\&.
.RE
.PP
config
.RS 4
The document element will be <nc:data>\&.
.RE
.PP
The XML prefix "nc" represents the standard NETCONF namespace with URI "urn:ietf:params:xml:ns:netconf:base:1\&.0"\&.
.SH "OPTIONS"
.PP
\fB\-t\fR \fItarget\fR, \fB\-\-target\fR \fItarget\fR
.RS 4
Specifies the target type of the output XML document, i\&.e\&. its document element\&. The default is
\fBdata\fR\&.
.RE
.PP
\fB\-o\fR \fIoutput_file\fR, \fB\-\-output\fR \fIoutput_file\fR
.RS 4
Write output to
\fIoutput_file\fR
instead of the standard output\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Displays help screen and exits\&.
.RE
.SH "EXAMPLE"
.sp
.if n \{\
.RS 4
.\}
.nf
$ pyang \-f jtox \-o dhcp\&.jtox dhcp\&.yang
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
$ json2xml \-o dhcp\-data\&.xml dhcp\&.jtox dhcp\-data\&.json
.fi
.if n \{\
.RE
.\}
.PP
The first command generates the driver file
dhcp\&.jtox, which is then used for translating JSON file
dhcp\-data\&.json
to XML file
dhcp\-data\&.xml\&.
.SH "DIAGNOSTICS"
.PP
\fBjson2xml\fR
return codes have the following meaning:
.PP
0
.RS 4
No error (normal termination)
.RE
.PP
1
.RS 4
One of the input files cannot be read
.RE
.PP
2
.RS 4
Error in command line arguments
.RE
.PP
3
.RS 4
JSON to XML translation failed
.RE
.SH "SEE ALSO"
.PP
\m[blue]\fBdraft\-lhotka\-netmod\-yang\-json\fR\m[]\&\s-2\u[1]\d\s+2,
\fBpyang\fR(1),
\m[blue]\fBJSON\fR\m[]\&\s-2\u[2]\d\s+2\&.
.SH "AUTHOR"
.PP
\fBLadislav Lhotka\fR <\&lhotka@nic\&.cz\&>
.br
CZ\&.NIC
.RS 4
.RE
.SH "NOTES"
.IP " 1." 4
draft-lhotka-netmod-yang-json
.RS 4
\%http://tools.ietf.org/html/draft-lhotka-netmod-yang-json
.RE
.IP " 2." 4
JSON
.RS 4
\%http://www.json.org/
.RE
